package com.liuxingyu.person.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.liuxingyu.common.RedisUtils;
import com.liuxingyu.person.service.IPersonService;


/**
* @author liuxingyu01
* @version 创建时间：2020-12-15 23:29:58
* @description 
*/

@Controller
@RequestMapping("/person")
public class PersonController {
	
	@Autowired
	private IPersonService personService;
	
	
	@Autowired
	private RedisUtils redisUtils;
	
	
	@RequestMapping(value = "/getUserInfo",method = RequestMethod.GET)
	@ResponseBody
	public Object getPersonById(@RequestParam(value = "user_id", required = true) String user_id){
		
		List personList = personService.getPersonById(user_id);
		
		// 测试RedisUtils
        redisUtils.set("redisUtilsff33wqw", personList, 300);
	
		return personList;
	}
	
	

}
